<?php
header("Content-type: text/html; charset=utf-8");
ini_set("soap.wsdl_cache_enabled", "0");
ini_set('display_errors',1);
set_time_limit(0); 
include_once dirname(dirname(__FILE__)).'/mgtv_init.php';
$db = nn_get_db(NL_DB_WRITE);



$sql = "select * from nns_mgtvbk_c2_log where nns_org_id='sihua_huawei' and  ISNULL(nns_notify_result) limit 10";

$list = nl_db_get_all($sql, $db);
$wsdl = 'http://127.0.0.1/nn_cms_mgtvbk/mgtv/sihua_huawei/sihua_huawei_notify.php?wsdl';
foreach ($list as $key => $value) {
	
	$soap_client = new SOAPClient($wsdl);
	var_dump($soap_client);
	$CSPID = 'hntv';
	$LSPID = 'hntv';
	$CorrelateID = $value['nns_id'];
	
	
	$CmdResult = '0';
	
	$ResultFileURL = '';
	$ret = $soap_client->ResultNotify($CSPID,$LSPID,$CorrelateID,$CmdResult,$ResultFileURL);
	var_dump($ret);
	// $postdata = array($CSPID,$LSPID,$CorrelateID,$CmdResult,$ResultFileURL);
	// //i_write_log_core('notify data '.var_export($postdata,true),$value['nns_org_id'].'/c2');
	// //echo 'game over '.$value['nns_org_id'];
// 	
// 	
	// $c2_notify = array(
		// 'nns_id'=>$CorrelateID,
		// 'nns_notify_result_url'=>$ResultFileURL,
		// 'nns_notify_result'=>$CmdResult,
		// );
		// c2_task_model::save_c2_notify($c2_notify);
}


